package com.aurora.source.util.netutil;

import com.aurora.source.authority.bean.CommodityManagementBean;
import com.aurora.source.authority.bean.PersonAuthAddBean;
import com.aurora.source.authority.bean.PersonAuthBean;
import com.aurora.source.authority.bean.ProcessDataBean;
import com.aurora.source.authority.bean.SysAuthDataBean;
import com.aurora.source.base.BaseBean;
import com.aurora.source.base.UpdateBean;
import com.aurora.source.center.bean.AddBatchBean;
import com.aurora.source.center.bean.FlowDataBean;
import com.aurora.source.center.bean.OprationRecoredListBean;
import com.aurora.source.constant.AuroraConstants;
import com.aurora.source.home.bean.BatchManagementBean;
import com.aurora.source.home.bean.ContactUsDataBean;
import com.aurora.source.home.bean.NewAreaBean;
import com.aurora.source.home.bean.NewCityBean;
import com.aurora.source.home.bean.NewProvinceBean;
import com.aurora.source.source.bean.UserInfoBean;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.QueryMap;

/**
 * @author: Lance
 * @description: 请求Api
 * @date: 2018/7/6 14:02
 */
public interface RetrofitService {
    // 自动更新
    @GET(AuroraConstants.getNewAppVersion)
    Observable<BaseBean<UpdateBean>> automaticUpdate(@QueryMap Map<String, String> params);

    //登录
    @FormUrlEncoded
    @POST(AuroraConstants.loginSource)
    Observable<BaseBean<UserInfoBean>> loginSource(@FieldMap Map<String, String> mRequestMap);

    //查询企业信息
    @GET(AuroraConstants.enterpriseInformation)
    Observable<BaseBean<ContactUsDataBean>> contactUsSource(@QueryMap Map<String, String> mRequestMap);

    //录入流程信息
    @GET(AuroraConstants.queryRoleInfoList)
    Observable<BaseBean<FlowDataBean>> getFlowInfo(@QueryMap Map<String, String> mRequestMap);

    @Multipart// 上传荣誉资质图片
    @POST(AuroraConstants.updateCompanyHonorOrQuarantine)
    Observable<BaseBean<String>> updateCompanyHonorOrQuarantine(@Part List<MultipartBody.Part> partList);

    // 权限管理
    @GET(AuroraConstants.authorityManagement)
    Observable<BaseBean<PersonAuthBean>> authManage(@QueryMap Map<String, String> mRequestMap);

    // 权限管理-查看
    @GET(AuroraConstants.jurisdictionExamine)
    Observable<BaseBean<UserInfoBean>> examine(@QueryMap Map<String, String> mRequestMap);

    //删除企业资源
    @GET(AuroraConstants.deleteCompanyResource)
    Observable<BaseBean> deleteCompanyResource(@QueryMap Map<String, String> mRequestMap);

    // 权限管理-添加用户
    @Multipart
    @POST(AuroraConstants.personAuthAdd)
    Observable<BaseBean<PersonAuthAddBean>> affirmAdd(@Part List<MultipartBody.Part> partList);

    // 所有权限查询
    @GET(AuroraConstants.addJurisdiction)
    Observable<BaseBean<ProcessDataBean>> addJurisdiction(@QueryMap Map<String, String> mRequestMap);

    // 添加批次
    @GET(AuroraConstants.addBatch)
    Observable<BaseBean<AddBatchBean>> addBatch(@QueryMap Map<String, String> mRequestMap);

    // 添加批次
    @GET(AuroraConstants.batchManagement)
    Observable<BaseBean<BatchManagementBean>> batchManagement(@QueryMap Map<String, String> mRequestMap);


    @Multipart// 修改公司banner或视频接口
    @POST(AuroraConstants.updateCompanyBannerOrVideo)
    Observable<BaseBean> upDataCopImgOrVideo(@Part List<MultipartBody.Part> partList);

    // 修改企业信息
    @FormUrlEncoded
    @POST(AuroraConstants.updateCompanyInfo)
    Observable<BaseBean> upDataCopInfo(@FieldMap Map<String, String> mRequestMap);

    // 省
    @GET(AuroraConstants.province)
    Observable<BaseBean<List<NewProvinceBean>>> getProvince(@QueryMap Map<String, String> mRequestMap);

    // 市
    @GET(AuroraConstants.city)
    Observable<BaseBean<List<NewCityBean>>> getCity(@QueryMap Map<String, String> mRequestMap);

    // 区
    @GET(AuroraConstants.area)
    Observable<BaseBean<List<NewAreaBean>>> getArea(@QueryMap Map<String, String> mRequestMap);

    // 注销
    @GET(AuroraConstants.cancelledUser)
    Observable<BaseBean> regist(@QueryMap Map<String, String> mRequestMap);

    // 验证码
    @GET(AuroraConstants.smsVerification)
    Observable<BaseBean> smsVerification(@QueryMap Map<String, String> mRequestMap);

    // 修改密码
    @GET(AuroraConstants.changePassword)
    Observable<BaseBean> changePassword(@QueryMap Map<String, String> mRequestMap);

    // 修改用户授权
    @GET(AuroraConstants.updateUserRole)
    Observable<BaseBean> updateUserRole(@QueryMap Map<String, String> mRequestMap);

    // 商品管理
    @GET(AuroraConstants.commodityManagement)
    Observable<BaseBean<CommodityManagementBean>> commodityManagement(@QueryMap Map<String, String> mRequestMap);

    @Multipart// 修改公司banner或视频接口
    @POST(AuroraConstants.minervaModification)
    Observable<BaseBean> portrait(@Part List<MultipartBody.Part> partList);

    @Multipart//提交流程记录
    @POST(AuroraConstants.addProcessRecording)
    Observable<BaseBean> addFlowRecored(@Part List<MultipartBody.Part> partList);

    // 查询流程记录
    @GET(AuroraConstants.queryRecordingList)
    Observable<BaseBean<OprationRecoredListBean>> queryRecordingList(@QueryMap Map<String, String> mRequestMap);

    // 结束流程，上链
    @GET(AuroraConstants.windingRecordingInfo)
    Observable<BaseBean> finishFlow(@QueryMap Map<String, String> mRequestMap);

    //添加产品，选择最终生成的批次号
    @GET(AuroraConstants.selectBatchList)
    Observable<BaseBean<BatchManagementBean>> getBatchList(@QueryMap Map<String, String> mRequestMap);

    //添加商品
    @Multipart
    @POST(AuroraConstants.addProduct)
    Observable<BaseBean> addProductInfo(@Part List<MultipartBody.Part> parts);

    //修改主批次名称或状态
    @GET(AuroraConstants.updateCompanyBatch)
    Observable<BaseBean> changeBatchNameOrState(@QueryMap Map<String, String> mRequestMap);

    // 修改电话
    @FormUrlEncoded
    @POST(AuroraConstants.resetUseMobile)
    Observable<BaseBean> resetUseMobile(@FieldMap Map<String, String> mRequestMap);

    //得到系统权限列表
    @GET(AuroraConstants.getSysPermission)
    Observable<BaseBean<SysAuthDataBean>> getSysPermission(@QueryMap Map<String, String> mRequestMap);
}
